
#include "Test.h"
#include <stdio.h>

REGISTER_CLASS_CREATOR(Test);

Test::Test()
{
    printf("class Test construct. this = %p\n", this);
}

void Test::native_test()
{
    printf("__ %s:%d\n", __PRETTY_FUNCTION__, __LINE__);
    printf("Test::native_test. this = %p\n", this);

    // call java method test.
    callJava();

    // new instance test.
    Test* t = new Test();
    t->createAndBindJavaObject(mEnv);
    t->callJava();
}


void Test::callJava()
{
    mEnv->CallVoidMethod(mThiz, mTestMethod, 2);
}

void Test::_native_test(JNIEnv* env, jobject thiz)
{
    Test* t = (Test*)getObjectFromJava(env, thiz);
    t->native_test();

}

